package cn.dd.crmweb.modules.fact.controller;


import cn.dd.crmweb.common.Result;
import cn.dd.crmweb.modules.fact.entity.Fact;
import cn.dd.crmweb.modules.fact.service.IFactService;
import cn.dd.crmweb.modules.sys.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("fact")
public class FactController {

    @Autowired
    private IFactService factService;

    /**
     * 查询所有
     * @return
     */
    @GetMapping("list")
    public Result findAll(){
        return Result.success(factService.list());
    }

    /**
     * 新增或更新
     */
    @PostMapping("/add")
    public boolean save(@RequestBody Fact fact){
        return factService.saveOrUpdate(fact);
    }
}
